package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.RoleMapper;
import com.example.shoppingmall.pojo.Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleService {
    @Autowired
    private RoleMapper roleMapper;

    public List<Role> roleList(){
        return roleMapper.roleList();
    }

    public List<Role>roleListTiaoJian(@Param("name")String name, @Param("no")int no){
        return roleMapper.roleListTiaoJian(name,no);
    }

    public int count(@Param("name")String name){
        return roleMapper.count(name);
    }

    public int delete(@Param("id")int id){
        return roleMapper.delete(id);
    }

    public int add(@Param("name")String name){
        return roleMapper.add(name);
    }

    public Role chackName(@Param("name")String name){
        return roleMapper.chackName(name);
    }

    public Role xiangQing(@Param("id")int id){
        return roleMapper.xiangQing(id);
    }
}
